﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace TableTop.DataManagement.Addon
{    
    internal class AddonHelper        
    {
        public static bool IsAddonAssembly(String AssemblyFilename)
        {
            AppDomain Helperdomain = null;
            AddonDomainHelper adhHelper = null;
            bool bResult = false;

            Helperdomain = AppDomain.CreateDomain("AddonHelperDomain");
            adhHelper = (AddonDomainHelper) Helperdomain.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName,
                                                                                 typeof(AddonDomainHelper).FullName);
            bResult = adhHelper.IsAddonAssembly(AssemblyFilename);
            AppDomain.Unload(Helperdomain);
            return bResult;            
        }             
    }
}
